﻿#include "mainwindow.h"
#include <QApplication>
#include <QDesktopWidget>
#include <QSurfaceFormat>
#include <QDebug>

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    MainWindow mainWindow;

    QSurfaceFormat fmt;
    fmt.setDepthBufferSize(24); //set the minimum depth buffer size to 24

    /*if (QCoreApplication::arguments().contains(QStringLiteral("--multisample"))){
        fmt.setSamples(4);
    }

    if (QCoreApplication::arguments().contains(QStringLiteral("--coreprofile"))) {
        fmt.setVersion(3, 2);
        fmt.setProfile(QSurfaceFormat::CoreProfile);
    }

    if (QCoreApplication::arguments().contains(QStringLiteral("--transparent"))) {
        mainWindow.setAttribute(Qt::WA_TranslucentBackground);
        mainWindow.setAttribute(Qt::WA_NoSystemBackground, false);
    }*/

    QSurfaceFormat::setDefaultFormat(fmt);

    mainWindow.resize(mainWindow.minimumSize());

    int desktopArea = QApplication::desktop()->width() * QApplication::desktop()->height();
    int widgetArea = mainWindow.width() * mainWindow.height();

    if (((float)widgetArea / (float)desktopArea) < 0.75f){
        mainWindow.show();
    }
    else{
        mainWindow.showMaximized();
    }

    return app.exec();
}
